package com.ruoyi.employee.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.employee.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/employee/dataStatistics")
public class DataStatisticsController {
    /**
     * 数据统计员工情况，在职，离职，退休，其他
     * @return
     */
    @Autowired
    private IEmployeeService employeeService;

    @PreAuthorize("@ss.hasPermi('employee:dataStatistics:list')")
    @GetMapping("/list")
    public AjaxResult list() {
        return AjaxResult.success(employeeService.getEmployeeList());
    }

    @PreAuthorize("@ss.hasPermi('employee:dataStatistics:list')")
    @GetMapping("/ageDivision")
    public AjaxResult ageDivision() {
        return AjaxResult.success(employeeService.getEmployeeAgeDivisionList());
    }
}
